﻿using Microsoft.DirectX;
using MultiResolutioning.Interfaces;

namespace MultiResolutioning.Structures
{
	/// <summary>
	/// Klasa reprezentuje koszt laczenia przez kontrakcje.
	/// </summary>
	public class ContractionCost: ICostable
	{
		private float cost;
		private Vertex withVertex;
		private Vector3 newPosition;

		/// <summary>
		/// Inicjalizuje obiekt.
		/// </summary>
		public ContractionCost()
		{
			this.cost = 0;
			this.withVertex = null;
			this.newPosition = new Vector3();
		}

		/// <summary>
		/// Inicjalizuje obiekt.
		/// </summary>
		/// <param name="cost">Koszt.</param>
		/// <param name="vertex">Wierzcholek docelowy.</param>
		/// <param name="newPosition">Nowa pozycja.</param>
		public ContractionCost(float cost, Vertex vertex, Vector3 newPosition)
		{
			this.cost = cost;
			this.withVertex = vertex;
			this.newPosition = newPosition;
		}

		/// <summary>
		/// Ustawia lub zwraca koszt.
		/// </summary>
		/// <value>
		/// Koszt.
		/// </value>
		public float Cost
		{
			get { return this.cost; }
			set { this.cost = value; }
		}

		/// <summary>
		/// Ustawia lub usuwa cel.
		/// </summary>
		/// <value>
		/// Cel.
		/// </value>
		public Vertex Target
		{
			get { return this.withVertex; }
			set { this.withVertex = value; }
		}

		/// <summary>
		/// Ustawia lub usuwa wspolrzedne nowej pozycji.
		/// </summary>
		/// <value>
		/// Nowa pozycja.
		/// </value>
		public Vector3 NewPosition
		{
			get { return this.newPosition; }
			set { this.newPosition = value; }
		}
	}
}
